package com.noahplat.device.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName: Model
 * @Description: 设备型号实体类
 * @Author 李景星
 * @Date 2021/3/3
 * @Version 1.0
 */
@Data
@Table(name = "enum_model")
public class Model implements Serializable {

    @Id
    @KeySql(useGeneratedKeys = true)
    private Long id;    //主键

    @NotEmpty(message = "设备型号不能为空")
    @Length(max = 20, message = "诺亚自定义设备型号长度不符")
    private String mymodel;     //诺亚自定义设备型号

    @NotEmpty(message = "设备型号不能为空")
    @Length(max = 20, message = "设备供应商设备型号长度不符")
    private String promodel;    //设备供应商设备型号

    @NotEmpty(message = "设备型号示例图片不能为空")
    @Length(max = 128, message = "设备型号示例图片长度不符")
    private String image;   //设备型号示例图片

    @Column(name = "create_time")
    @NotEmpty(message = "创建时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;   //创建时间
}
